package HomeWork;
/*
2．需求：求出数组中索引与索引对应的元素都是奇数的元素
 */
public class Test02 {
    public static void main(String[] args) {
        int[] a = new int[10];


        //赋值
        for(int i = 0; i < a.length; i++){
            a[i] = (int)(Math.random()*100+1);
            System.out.print(a[i]+" ");
        }
        System.out.println();

        //判断
        for(int i = 0; i < a.length; i++){
            if(i%2 == 0){
                if(a[i]%2 == 0){
                    System.out.println(i + " " + a[i]);
                }
            }
        }
    }
}
